#include <iostream>
#include <string>
#include <vector>
using namespace std;

template <typename Iter, typename T>
Iter findElem(Iter first, Iter last,const T&val){
	while(first != last){
		if(*first == val)
			return first;
		++ first;
	}
	return last;
}

int main(){
	int ia[] = {1,2,3,4,5,6,7,8,9};
	vector<int> ivec(ia,ia+7);
	string sa[] = {"this","is","mary","test","example"};
	vector<string> svec(sa,sa+5);

	vector<int>::iterator it;

	if((it=findElem(ivec.begin(),ivec.end(),7)) != ivec.end())
		cout << "find " << *it << endl;
	else
		cout <<"not find " << endl;

	vector<string>::iterator sit;
	if((sit=findElem(svec.begin(),svec.end(),"example")) != svec.end())
		cout << "find string:" << *sit << endl;
	else
		cout <<"not find string" << endl;

	

	
	
	return 0;
}

